// 引入请求
import request from './request.js'

const PPUrlHeadr = 'https://api.pencil-stub.com'
const SaleUrlHeadr = 'https://sale.pencil-stub.com/prod-api'
// const SaleUrlHeadr = 'http://localhost:8080'
let api = {}
//接口示例
api.version = data => request.post(PPUrlHeadr + '/app/version/latest/get', data)
api.getWeChatId = data => request.post(SaleUrlHeadr + '/applet/get_user_id', data) //获取微信
api.bindWechat = data => request.post(SaleUrlHeadr + '/bind', data) //绑定微信id
api.getHotBook = data => request.post(PPUrlHeadr + '/black_rock/hot', {}) //获取热门书单
api.getBookInfo = data => request.post(PPUrlHeadr + '/book/v2/info', data) //获取单本小说
api.getBookChoice = data => request.post(PPUrlHeadr + '/black_rock/main', data) //获取精选内容
api.searchBook = data => request.post(SaleUrlHeadr + '/applet/books', data) //搜索书籍
api.searchOrder = data => request.post(SaleUrlHeadr + '/applet/orders', data) //搜索订单
api.getMoney = data => request.post(SaleUrlHeadr + '/applet/get_user_money', data) //获取最新余额
api.getCashOrder = data => request.post(SaleUrlHeadr + '/applet/cash/list', data) //获取提现记录
api.getProduct = data => request.post(SaleUrlHeadr + "/product/info/list", data) //获取所有分佣产品
api.getBill = data => request.post(SaleUrlHeadr + "/bill/settlementBill/list/byWechat", data) //获取可提现账单
api.addCash = data => request.post(SaleUrlHeadr + "/bill/settlementBill/cash", data) //提交提现申请


// api.getBookCode = data => request.post(PPUrlHeadr + '/black_rock/code', data) //获取搜索码
// api.getBookQRCode = data => request.post(PPUrlHeadr + '/black_rock/qrcode', data) //获取二维码

api.getBookCode = data => request.post(PPUrlHeadr + '/book/v2/code', data) //获取推广信息

export default api;